***This do-file creates Figure 2 of the paper
**Curtis RESTAT
**Change to directory where data and code were downloaded
**cd 
clear all


insheet using "DLY_2002al.csv", comma
save al2002, replace
clear
insheet using "DLY_2002ct.csv", comma
save ct2002, replace
clear

insheet using "DLY_2002dc.csv", comma
save dc2002, replace
clear

insheet using "DLY_2002de.csv", comma
save de2002, replace
clear

insheet using "DLY_2002il.csv", comma
save il2002, replace
clear

insheet using "DLY_2002in.csv", comma
save in2002, replace
clear

insheet using "DLY_2002ky.csv", comma
save ky2002, replace
clear

insheet using "DLY_2002ma.csv", comma
save ma2002, replace
clear

insheet using "DLY_2002md.csv", comma
save md2002, replace
clear

insheet using "DLY_2002mi.csv", comma
save mi2002, replace
clear

insheet using "DLY_2002nc.csv", comma
save nc2002, replace
clear

insheet using "DLY_2002nj.csv", comma
save nj2002, replace
clear

insheet using "DLY_2002ny.csv", comma
save ny2002, replace
clear

insheet using "DLY_2002oh.csv", comma
save oh2002, replace
clear

insheet using "DLY_2002pa.csv", comma
save pa2002, replace
clear

insheet using "DLY_2002ri.csv", comma
save ri2002, replace
clear

insheet using "DLY_2002sc.csv", comma
save sc2002, replace
clear

insheet using "DLY_2002tn.csv", comma
save tn2002, replace
clear

insheet using "DLY_2002va.csv", comma
save va2002, replace
clear

insheet using "DLY_2002wv.csv", comma
save wv2002, replace
clear


insheet using "DLY_2005al.csv", comma
save al2005, replace
clear

insheet using "DLY_2005ct.csv", comma
save ct2005, replace
clear

insheet using "DLY_2005dc.csv", comma
save dc2005, replace
clear

insheet using "DLY_2005de.csv", comma
save de2005, replace
clear

insheet using "DLY_2005il.csv", comma
save il2005, replace
clear

insheet using "DLY_2005in.csv", comma
save in2005, replace
clear

insheet using "DLY_2005ky.csv", comma
save ky2005, replace
clear

insheet using "DLY_2005ma.csv", comma
save ma2005, replace
clear

insheet using "DLY_2005md.csv", comma
save md2005, replace
clear

insheet using "DLY_2005mi.csv", comma
save mi2005, replace
clear

insheet using "DLY_2005nc.csv", comma
save nc2005, replace
clear

insheet using "DLY_2005nj.csv", comma
save nj2005, replace
clear

insheet using "DLY_2005ny.csv", comma
save ny2005, replace
clear

insheet using "DLY_2005oh.csv", comma
save oh2005, replace
clear

insheet using "DLY_2005pa.csv", comma
save pa2005, replace
clear

insheet using "DLY_2005ri.csv", comma
save ri2005, replace
clear

insheet using "DLY_2005sc.csv", comma
save sc2005, replace
clear

insheet using "DLY_2005tn.csv", comma
save tn2005, replace
clear

insheet using "DLY_2005va.csv", comma
save va2005, replace

clear

insheet using "DLY_2005wv.csv", comma
save wv2005, replace
clear

dsconcat al2002 ct2002 dc2002 de2002 il2002 in2002 ky2002 ma2002 md2002 mi2002 nc2002 nj2002 ny2002 oh2002 pa2002 ri2002 sc2002 tn2002 va2002 wv2002 al2005 ct2005 dc2005 de2005 il2005 in2005 ky2005 ma2005 md2005 mi2005 nc2005 nj2005 ny2005 oh2005 pa2005 ri2005 sc2005 tn2005 va2005 wv2005


collapse (sum) nox_mass, by(op_date)
gen date= date(op_date,"MDY")
gen year= substr(op_date,-4,.)



gen day=substr(op_date,1,5)
drop op_date date
reshape wide nox_mass,i(day) j(year) s
gen n=_n

tsset n

tsline nox_mass2002 nox_mass2005, play(fig2edit.grec)


